# -*- coding: utf-8 -*-
# @description: 
# @File  : greenlet_client.py
# @Time  :2020-04-01 21:04:21
# @Author:selfeasy
# @Email :gm_selfeasy@163.com
from werkzeug.local import Local, LocalManager
from werkzeug.wrappers import Request, Response

local = Local()
local_manager = LocalManager(local)
def app(env, start_response):
    local.request = request =  Request(env)
    resp = Response('hello werkzeug from ' + str(request.environ))
    for k, v in local:
        print(k, v)
    return resp(env, start_response)

app = local_manager.middleware(app)
